﻿<UserControl
    x:Class="XamlInspector.Presentation.EventControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:XamlInspector.Presentation"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    RequestedTheme="Light"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400">
<UserControl.Resources>

        <Style TargetType="ListBoxItem">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ListBoxItem">
                        <Grid Margin="2" >
                            <ContentPresenter Content="{TemplateBinding Content}" VerticalAlignment="Center" Margin="10,0" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Button Command="{Binding ClearCommand}" Content="Clear" FontSize="14"  />
        <ListBox Grid.Row="1" ItemsSource="{Binding Events}"  >
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="{Binding DateTimeText}" FontSize="14" />
                        <TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="14" />
                        <TextBlock Grid.Column="2" Text="{Binding Source}" FontSize="14" />
                        <TextBlock Grid.Column="3" Text="{Binding Data}" FontSize="14" />
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</UserControl>
